package Day6Zuoye;

import java.io.*;

public class Test2 {
    public static void main(String[] args) {
        BufferedReader br=null;
        String a="";
        String b="";
        try {
            InputStreamReader isr=new InputStreamReader(new FileInputStream("C:\\Users\\Administrator\\Desktop\\xinjian\\data.txt"));
            br=new BufferedReader(isr);
            a=br.readLine();
            int c=Integer.parseInt(a);
            while ((b=br.readLine())!=null){
                int d=Integer.parseInt(b);
                if (d>c){
                    c=d;
                }
            }
            System.out.println("找到最大的数是:"+c);
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
